package com.appero.metier;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.appero.util.RecettesParserXML;

import android.content.Context;

public class SingletonListeIngredients {

	private static SingletonListeIngredients instance = null;
	private List<String> listeAlcool = null;
	private List<String> listeSoft = null;
	private List<String> listeDivers = null;
	private Context context = null;
	
	private SingletonListeIngredients(Context context)
    {
		setListeAlcool(new ArrayList<String>());
		setListeSoft(new ArrayList<String>());
		setListeDivers(new ArrayList<String>());
		// Appel au parseur pour remplir la liste
		
		this.context = context;
		
    }
	
	
	public static SingletonListeIngredients getInstance(Context context) {
		
		if(instance == null)
		{
			instance = new SingletonListeIngredients(context);
		}
		
		return instance;
		
	}
	

	public static SingletonListeIngredients getInstance() {
		
				
		return instance;
		
	}
	
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		
		sb.append("Alcool :").append("\n");
		for(int i = 0; i<listeAlcool.size(); i++){
			String s = listeAlcool.get(i);
		
			sb.append(s).append("\n");
		}
		
		sb.append("\n");
		sb.append("Soft :").append("\n");
		for(int i = 0; i<listeSoft.size(); i++){
			String s = listeSoft.get(i);
		
			sb.append(s).append("\n");
		}
		
		sb.append("\n");
		sb.append("Divers :").append("\n");
		for(int i = 0; i<listeDivers.size(); i++){
			String s = listeDivers.get(i);
		
			sb.append(s).append("\n");
		}
		return sb.toString();
		
	}


	public List<String> getListeAlcool() {
		return listeAlcool;
	}


	public void setListeAlcool(List<String> listeAlcool) {
		this.listeAlcool = listeAlcool;
	}


	public List<String> getListeSoft() {
		return listeSoft;
	}


	public void setListeSoft(List<String> listeSoft) {
		this.listeSoft = listeSoft;
	}


	public List<String> getListeDivers() {
		return listeDivers;
	}


	public void setListeDivers(List<String> listeDivers) {
		this.listeDivers = listeDivers;
	}
}
